package chapter01;

public class TestYield extends Thread {
    public TestYield(String name){
        super(name);
    }


    public void run(){

        for (int i = 0;i < 50;i++){

            System.out.println(getName() + "" + i);
            if(i == 20){

                Thread.yield();

            }

        }

    }


    public static void main(String[]  args){
        TestYield t1 =  new TestYield("HHHHHHH");
        t1.setPriority(Thread.MAX_PRIORITY);
        t1.start();


        TestYield t2 =  new TestYield("L");
        t2.setPriority(Thread.MIN_PRIORITY);
        t2.start();

    }
}
